#!/system/xbin/ash
#
# load adbd during first boot if property is set

if [ -f /system/firstboot ]; then

    busybox mount -o remount,rw /system
    rm -f /system/firstboot

    # Clean market cache
    rm -f /data/data/com.android.providers.downloads/cache/*

    #DISABLED:
    exit 0

    LOAD_ADBD=`getprop persist.service.adb.enable`
    USB_LINK=`cat /sys/class/power_supply/usb/online`

    if [ "$LOAD_ADBD $USB_LINK" = "1 1" ]; then

        echo charge_adb > /dev/usb_device_mode

        # set initial state for usb.apk
        echo usb_mode_charge_adb > /tmp/usbd_current_state
        chmod 666 /tmp/usbd_current_state

    fi

fi

